from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import TaskViewSet, CategoryViewSet, TagViewSet
#这个参数设置生成的url是否包含尾斜杠，默认为True，表示生成的url会包含尾斜杠。设置为False表示生成的url不包含尾斜杠。
router = DefaultRouter(trailing_slash=False)
router.register(r'tasks', TaskViewSet)
router.register(r'categories', CategoryViewSet)
router.register(r'tags', TagViewSet)

urlpatterns = [
    path('', include(router.urls)),
] 